<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>纯CSS绘制三角形</title>
    <style>
        /* 切图 - http 
        四个方位 20px   
      */
        .triangle1 {
            width: 0;
            height: 0;
            border-width: 20px;
            border-style: solid;
            border-color: green greenyellow blue pink;
        }

        .triangle2 {
            width: 0;
            height: 0;
            border-width: 20px 20px 20px 20px;
            border-style: solid;
            border-color: green transparent transparent transparent;
        }
            
        .triangle3 {
            width: 0;
            height: 0;
            border-color: transparent red transparent transparent;
            border-style: solid;
            border-width: 22px 8px 0 0;
        }
    </style>
</head>

<body>
    <div class="triangle1"></div>
    <div class="triangle2"></div>
    <div class="triangle3"></div>
    <div class="triangle4"></div>
</body>

</html>